import Vue from 'vue'
import Router from 'vue-router'


const Hello = resolve => require(['@/components/Hello'], resolve)
const giftSend = resolve => require(['@/page/gift_send_one'], resolve)
const giftShare = resolve => require(['@/page/gift_share'], resolve)
const giftReceive = resolve => require(['@/page/gift_receive'], resolve)
const giftReceived = resolve => require(['@/page/gift_received'], resolve)
const userAddress = resolve => require(['@/page/user_address'], resolve)
const marketGroup = resolve => require(['@/page/market_group'], resolve)
const userConfirm = resolve => require(['@/page/user_confirm'], resolve)
const listAddress = resolve => require(['@/page/list_address'], resolve)

Vue.use(Router)

export default new Router({
    //mode: 'history',
    routes: [{
            path: '/',
            name: 'Hello',
            component: Hello
        },
        {
            path: '/gift/send/:id',
            name: 'gift_send',
            component: giftSend,
        },
        {
            path: '/gift/share/:order_id',
            name: 'gift_share',
            component: giftShare,
        },
        {
            path: '/gift/receive/:gift_id',
            name: 'gift_receive',
            component: giftReceive,
            meta: {
                title: '礼物领取',
            }

        },
        {
            path: '/gift/received/:gift_id',
            name: 'gift_received',
            component: giftReceived,
        },
        {
            path: '/user/address/:gift_id',
            name: 'user_address',
            component: userAddress,
            meta: {
                title: '礼物领取',
                requiresAuth: true
            }
        },
        {
            path: '/mall/group',
            name: 'market_group',
            component: marketGroup,
        },
        {
            path: '/user/confirm/:gift_id',
            name: 'user_confirm',
            component: userConfirm,
            meta: {
                title: '领取礼物',
                //requiresAuth: true
            }
        },
        {
            path: '/list/address/:gift_id',
            name: 'list_address',
            component: listAddress,
            meta: {
                title: '收货地址',
                requiresAuth: true
            }
        },
    ]
})